]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
background: don't choke on huge slide show durations
authorRay Strode <rstrode@redhat.com>
Mon, 25 Mar 2013 14:42:21 +0000 (10:42 -0400)
committerRay Strode <rstrode@redhat.com>
Tue, 26 Mar 2013 21:02:05 +0000 (17:02 -0400)
if a slideshow file has a really large duration we'll currently
throw an exception.

This bug is aggravated by the fact that some versions of
gnome-desktop use UINT_MAX as a sentinel value to mean,
"don't ever update slide".

This commit treats durations that would overflow as infinitely
long.

https://bugzilla.gnome.org/show_bug.cgi?id=696157

js/ui/background.js

index 2625452226f2907e246661f48838c60c84b40453..8c2870c4532c3c9d9f6e8cebc6420005f66f6375 100644 (file)
@@ -503,6 +503,10 @@ const Background = new Lang.Class({
 
         let interval = Math.max(ANIMATION_MIN_WAKEUP_INTERVAL * 1000,
                                 timePerStep);
+
+        if (interval > GLib.MAXUINT32)
+            return;
+
         this._updateAnimationTimeoutId = GLib.timeout_add(GLib.PRIORITY_DEFAULT,
                                                       interval,
                                                       Lang.bind(this, function() {